<?php

class Data 
{
	public static function getDataENNow()
	{
		return date("Y-m-d");
	}
	
	public static function getDataBanco($data)
	{
		return "date_format($data,'%d/%m/%Y')";	
	}
	
	public static function getDataBR($data)
	{
		$dat    = substr($data, 0, 10);
		$time    = substr($data, 10, 15);
		$dat    = explode ("-", $dat);
		$time    = explode (":", $time);

		$rstData = "$dat[2]/$dat[1]/$dat[0] $time[0]:$time[1]";
		
		return $rstData;
	}
	
	public static function getDataHBR($data)
	{
		$dat    = substr($data, 0, 10);
		$time    = substr($data, 10, 15);
		$dat    = explode ("-", $dat);
		$time    = explode (":", $time);

		$rstData = "$dat[2]/$dat[1]/$dat[0]";
		
		return $rstData;
	}
	
	public static function getHora($data)
	{
		$dat    = substr($data, 0, 10);
		$time    = substr($data, 10, 15);
		$dat    = explode ("-", $dat);
		$time    = explode (":", $time);

		$rstData = "$time[0]:$time[1]";
		
		if($time[0] == "00" && $time[1] == "00")
		{
			return;
		}
		
		return $rstData;
	}
	
	public static function getDataEN($data)
	{
		$data    = substr($data, 0, 10);
		$d       = explode ("/", $data);
		$rstData = "$d[2]-$d[1]-$d[0]";
		
		return $rstData;
	}
}

?>
